package org.tbwork.utility.httprr;

import java.io.IOException;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class TestHttpClient {

    public static void main(String[] args) throws Exception, IOException {
    	 CloseableHttpClient httpclient = HttpClients.createDefault();

         HttpGet httpget = new HttpGet("http://www.shfapiao.cn/");

         HttpResponse response = httpclient.execute(httpget);

         HttpEntity entity = response.getEntity();

         String html = EntityUtils.toString(entity);              

         System.out.println(html);
         
         httpclient.close();

    }
}